package com.hexacta.hrs;

import org.openqa.selenium.server.SeleniumServer;

/**
 * Selenium Server Fixture is a delegate object responsible for starting and
 * stopping the Selenium server. It should simplify the logic for the test
 * classes, and promote reuse.
 * 
 * @author tpollak
 */
public class SeleniumServerFixture {
    public static final int SELENIUM_SERVER_PORT = 4444;

    private final SeleniumServer server;

    public SeleniumServerFixture() {
        try {
            this.server = new SeleniumServer();
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
    }

    public void setUp() throws Exception {
        this.server.start();
    }

    public void tearDown() {
        this.server.stop();
    }
}
